import { NgModule, ErrorHandler } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { IonicApp, IonicModule, IonicErrorHandler } from 'ionic-angular';
import { MyApp } from './app.component';
import {HttpModule}from '@angular/http'

import { HomePage } from '../pages/home/home';
import {DiscoveryPage} from '../pages/discovery/discovery';
import {ChatPage} from '../pages/chat/chat';
import {NotificationPage} from '../pages/notification/notification';
import {MorePage} from '../pages/more/more';
import {LoginPage} from '../pages/login/login';
import {RegisterPage} from '../pages/register/register'
import { TabsPage } from '../pages/tabs/tabs';
import {UserPage} from '../pages/user/user';
import {HeadfacePage} from '../pages/headface/headface';
import {QuestionPage} from '../pages/question/question';
import {DetailsPage} from '../pages/details/details';
import {AnswerPage} from  '../pages/answer/answer';
import {ChatdetailsPage} from '../pages/chatdetails/chatdetails'
import {UserdatalistPage} from '../pages/userdatalist/userdatalist'
import {ScanPage} from '../pages/scan/scan'
import {VersionsPage} from '../pages/versions/versions'
import {BaidumapPage} from '../pages/baidumap/baidumap'
import {ImgpickerPage} from '../pages/imgpicker/imgpicker'
import {VideoPage} from '../pages/video/video'
import {AudioPage} from '../pages/audio/audio'

import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { RestProvider } from '../providers/rest/rest';
import {IonicStorageModule} from '@ionic/storage';
// 导入表情的provider
import { EmojiProvider } from '../providers/emoji/emoji';
//自定义组件
import {ComponentsModule} from '../components/components.module'
//自定义指令
import {DirectivesModule} from '../directives/directives.module'



//导入原生api插件
import {File} from '@ionic-native/file'
import {FilePath} from '@ionic-native/file-path'
import {Camera} from '@ionic-native/camera'
import {Transfer,TransferObject} from '@ionic-native/transfer'
import { ChatserviceProvider } from '../providers/chatservice/chatservice';
import { QRScanner} from '@ionic-native/qr-scanner';
import { AppVersion } from '@ionic-native/app-version';
import {BaiduMapModule} from 'angular2-baidu-map'
import {InAppBrowser} from '@ionic-native/in-app-browser'
import { StreamingMedia, StreamingVideoOptions } from '@ionic-native/streaming-media';


import { RelativetimePipe} from "../pipes/relativetime/relativetime"
import { SettingsProvider } from '../providers/settings/settings';
import { CacheimgserviceProvider } from '../providers/cacheimgservice/cacheimgservice';

//引入videogular2视频播放
import {VgCoreModule} from 'videogular2/core';
import {VgControlsModule} from 'videogular2/controls';
import {VgOverlayPlayModule} from 'videogular2/overlay-play';
import {VgBufferingModule} from 'videogular2/buffering';

//引入音频
import {IonicAudioModule,defaultAudioProviderFactory} from 'ionic-audio'

//引入极光推送
import { JPush } from '@jiguang-ionic/jpush';
import { JpushUtilProvider } from '../providers/jpush-util/jpush-util';


@NgModule({
  declarations: [
    MyApp,
    HomePage,
    DiscoveryPage,
    ChatPage,
    NotificationPage,
    MorePage,
    LoginPage,
    TabsPage,
    RegisterPage,
    UserPage,
    HeadfacePage,
    QuestionPage,
    DetailsPage,
    AnswerPage,
    ChatdetailsPage,
    RelativetimePipe,
    UserdatalistPage,
    ScanPage,
    VersionsPage,
    BaidumapPage,
    ImgpickerPage,
    VideoPage,
    AudioPage

  ],
  imports: [
    VgCoreModule,
    VgControlsModule,
    VgOverlayPlayModule,
    VgBufferingModule,
    IonicAudioModule.forRoot(defaultAudioProviderFactory),
    BrowserModule,
    HttpModule,//全局需要导入http
    IonicModule.forRoot(MyApp,{
      backButtonText:"返回"
    }),
    ComponentsModule,
    DirectivesModule,
    IonicStorageModule.forRoot(), //全局定义storage模块
   
    BaiduMapModule.forRoot({ ak: '76VugKm3AafEA4RCYa6Ft7OhkOaHO7sK' }) //百度地图
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp,
    HomePage,
    DiscoveryPage,
    ChatPage,
    NotificationPage,
    MorePage,
    LoginPage,
    TabsPage,
    RegisterPage,
    UserPage,
    HeadfacePage,
    QuestionPage,
    DetailsPage,
    AnswerPage,
    ChatdetailsPage,
    UserdatalistPage,
    ScanPage,
    VersionsPage,
    BaidumapPage,
    ImgpickerPage,
    VideoPage,
    AudioPage
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler},
    RestProvider, //rest 的定义导入
    File,
    Transfer,
    FilePath,
    Camera,
    QRScanner,
    AppVersion,
    EmojiProvider,
    ChatserviceProvider,
    SettingsProvider,
    InAppBrowser,
    CacheimgserviceProvider,
    StreamingMedia,
    JPush,
    JpushUtilProvider
  ]
})
export class AppModule {}
